const mongoose = require('mongoose')
const Schema = mongoose.Schema
const baseModel = require('./baseModel')

const { String, Array, ObjectId } = mongoose.Schema.Types

const userSchema = new Schema({
  ...baseModel,
  username: {
    type: String,
    required: true,
    unique: true,
  },
  password: {
    type: String,
    required: true,
  },
  friends: {
    type: [ObjectId],
    default: [],
  },
})

module.exports = userSchema
